home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  30.5 KB  |  942 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMICCPROFILE__
  18. #define __CMICCPROFILE__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26. #if PRAGMA_ONCE
  27. #pragma once
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37.  
  38. #if PRAGMA_STRUCT_ALIGN
  39.     #pragma options align=mac68k
  40. #elif PRAGMA_STRUCT_PACKPUSH
  41.     #pragma pack(push, 2)
  42. #elif PRAGMA_STRUCT_PACK
  43.     #pragma pack(2)
  44. #endif
  45.  
  46. /* Current CMProfile.header.profileVersion Major: 2, Minor: 0, Stage: Developement (x20), Prerelease:0x01 */
  47.  
  48. enum {
  49.     cmCS2ProfileVersion            = 0x02000000
  50. };
  51.  
  52. /* Current Major version number */
  53.  
  54. enum {
  55.     cmCurrentProfileMajorVersion = 0x02000000
  56. };
  57.  
  58. /* magic cookie number for anonymous file ID */
  59.  
  60. enum {
  61.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  62. };
  63.  
  64. /* ColorSync profile version 1.0 */
  65.  
  66. enum {
  67.     cmCS1ProfileVersion            = 0x00000100
  68. };
  69.  
  70.  
  71. /************************************************************************/
  72. /*************** ColorSync 2.0 profile specification ********************/
  73. /************************************************************************/
  74. /**** flags field  ****/
  75.  
  76. enum {
  77.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  78.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  79.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  80.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  81.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  82.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  83.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  84. };
  85.  
  86. /* copyright-protection flag options */
  87.  
  88. enum {
  89.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  90.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  91. };
  92.  
  93. /* speed and quality flag options */
  94.  
  95. enum {
  96.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  97.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  98.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  99. };
  100.  
  101.  
  102. /**** deviceAttributes fields ****/
  103.  
  104. enum {
  105.     cmICCReservedAttr0Mask        = 0x0000FFFF,                    /* these bits of the deviceAttributes[0] field are defined and reserved by ICC */
  106.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  107.     cmGlossyMatteMask            = 0x00000002,                    /* if bit 1 is 0 then glossy, if 1 then matte */
  108.     cmVendorReservedAttr0Mask    = (long)0xFFFF0000,                /* these bits of the deviceAttributes[0] field are defined and reserved by device vendor */
  109.     cmVendorReservedAttr1Mask    = (long)0xFFFFFFFF                /* these bits of the deviceAttributes[1] field are defined and reserved by device vendor */
  110. };
  111.  
  112. /* device/media attributes element values  */
  113.  
  114. enum {
  115.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  116.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  117. };
  118.  
  119.  
  120. /**** renderingIntent field ****/
  121.  
  122. enum {
  123.     cmPerceptual                = 0,                            /* Photographic images */
  124.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  125.     cmSaturation                = 2,                            /* Business graphics */
  126.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  127. };
  128.  
  129.  
  130.  
  131. /* data type element values */
  132.  
  133. enum {
  134.     cmAsciiData                    = 0,
  135.     cmBinaryData                = 1
  136. };
  137.  
  138. /* screen encodings  */
  139.  
  140. enum {
  141.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  142.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  143. };
  144.  
  145. /* 2.0 tag type information */
  146.  
  147. enum {
  148.     cmNumHeaderElements            = 10
  149. };
  150.  
  151. /* public tags */
  152.  
  153. enum {
  154.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  155.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  156.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  157.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  158.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  159.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  160.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  161.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  162.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  163.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  164.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  165.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  166.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  167.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  168.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  169.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  170.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  171.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  172.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  173.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  174.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  175.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  176.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  177.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  178.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  179.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  180.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  181.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  182.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  183.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  184.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  185.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  186.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  187.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  188.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  189.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  190.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  191.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  192.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  193.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  194.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  195.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  196. };
  197.  
  198. /* custom tags */
  199.  
  200. enum {
  201.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm'),
  202.     cmVideoCardGammaTag            = FOUR_CHAR_CODE('vcgt')
  203. };
  204.  
  205. /* technology tag descriptions */
  206.  
  207. enum {
  208.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  209.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  210.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  211.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  212.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  213.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  214.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  215.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  216.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  217.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  218.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  219.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  220.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  221.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  222.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  223.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  224.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  225.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  226.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  227.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  228.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  229. };
  230.  
  231. /* public type signatures */
  232.  
  233. enum {
  234.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  235.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  236.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  237.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  238.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  239.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  240.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  241.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  242.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  243.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  244.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  245.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  246.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  247.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  248.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  249.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  250.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  251.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  252.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  253.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  254. };
  255.  
  256. /* custom type signatures */
  257.  
  258. enum {
  259.     cmSigVideoCardGammaType        = FOUR_CHAR_CODE('vcgt')
  260. };
  261.  
  262.  
  263. /* Measurement type encodings */
  264. /* Measurement Flare */
  265.  
  266. enum {
  267.     cmFlare0                    = 0x00000000,
  268.     cmFlare100                    = 0x00000001
  269. };
  270.  
  271. /* Measurement Geometry    */
  272.  
  273. enum {
  274.     cmGeometryUnknown            = 0x00000000,
  275.     cmGeometry045or450            = 0x00000001,
  276.     cmGeometry0dord0            = 0x00000002
  277. };
  278.  
  279. /* Standard Observer    */
  280.  
  281. enum {
  282.     cmStdobsUnknown                = 0x00000000,
  283.     cmStdobs1931TwoDegrees        = 0x00000001,
  284.     cmStdobs1964TenDegrees        = 0x00000002
  285. };
  286.  
  287. /* Standard Illuminant */
  288.  
  289. enum {
  290.     cmIlluminantUnknown            = 0x00000000,
  291.     cmIlluminantD50                = 0x00000001,
  292.     cmIlluminantD65                = 0x00000002,
  293.     cmIlluminantD93                = 0x00000003,
  294.     cmIlluminantF2                = 0x00000004,
  295.     cmIlluminantD55                = 0x00000005,
  296.     cmIlluminantA                = 0x00000006,
  297.     cmIlluminantEquiPower        = 0x00000007,
  298.     cmIlluminantF8                = 0x00000008
  299. };
  300.  
  301. /* Spot Function Value */
  302.  
  303. enum {
  304.     cmSpotFunctionUnknown        = 0,
  305.     cmSpotFunctionDefault        = 1,
  306.     cmSpotFunctionRound            = 2,
  307.     cmSpotFunctionDiamond        = 3,
  308.     cmSpotFunctionEllipse        = 4,
  309.     cmSpotFunctionLine            = 5,
  310.     cmSpotFunctionSquare        = 6,
  311.     cmSpotFunctionCross            = 7
  312. };
  313.  
  314. /* Color Space Signatures */
  315.  
  316. enum {
  317.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  318.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  319.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  320.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  321.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  322.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  323.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  324.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  325.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  326.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  327.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  328.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  329.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  330.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8'),
  331.     cmNamedData                    = FOUR_CHAR_CODE('NAME')
  332. };
  333.  
  334. /* profileClass enumerations */
  335.  
  336. enum {
  337.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  338.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  339.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  340.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  341.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  342.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  343.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  344. };
  345.  
  346. /* platform enumerations */
  347.  
  348. enum {
  349.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  350.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  351.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  352.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  353.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  354. };
  355.  
  356. /* ColorSync 1.0 elements */
  357.  
  358. enum {
  359.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  360.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  361.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  362.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  363. };
  364.  
  365. /* General element data types */
  366.  
  367. struct CMDateTime {
  368.     unsigned short                     year;
  369.     unsigned short                     month;
  370.     unsigned short                     dayOfTheMonth;
  371.     unsigned short                     hours;
  372.     unsigned short                     minutes;
  373.     unsigned short                     seconds;
  374. };
  375. typedef struct CMDateTime                CMDateTime;
  376.  
  377. struct CMFixedXYZColor {
  378.     Fixed                             X;
  379.     Fixed                             Y;
  380.     Fixed                             Z;
  381. };
  382. typedef struct CMFixedXYZColor            CMFixedXYZColor;
  383.  
  384. typedef unsigned short                     CMXYZComponent;
  385.  
  386. struct CMXYZColor {
  387.     CMXYZComponent                     X;
  388.     CMXYZComponent                     Y;
  389.     CMXYZComponent                     Z;
  390. };
  391. typedef struct CMXYZColor                CMXYZColor;
  392.  
  393. struct CM2Header {
  394.     unsigned long                     size;                        /* This is the total size of the Profile */
  395.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  396.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  397.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  398.     OSType                             dataColorSpace;                /* color space of data */
  399.     OSType                             profileConnectionSpace;        /* profile connection color space */
  400.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  401.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  402.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  403.     unsigned long                     flags;                        /* profile flags */
  404.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  405.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  406.     unsigned long                     deviceAttributes[2];        /* Attributes like paper type */
  407.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  408.     CMFixedXYZColor                 white;                        /* profile illuminant */
  409.     OSType                             creator;                    /* profile creator */
  410.     char                             reserved[44];                /* reserved for future use */
  411. };
  412. typedef struct CM2Header                CM2Header;
  413.  
  414. struct CMTagRecord {
  415.     OSType                             tag;                        /* Registered with CS2 consortium */
  416.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  417.     unsigned long                     elementSize;
  418. };
  419. typedef struct CMTagRecord                CMTagRecord;
  420.  
  421. struct CMTagElemTable {
  422.     unsigned long                     count;
  423.     CMTagRecord                     tagList[1];                    /* Variable size */
  424. };
  425. typedef struct CMTagElemTable            CMTagElemTable;
  426. /* External 0x02002001 CMProfile */
  427.  
  428. struct CM2Profile {
  429.     CM2Header                         header;
  430.     CMTagElemTable                     tagTable;
  431.     char                             elemData[1];                /* Tagged element storage. Variable size */
  432. };
  433. typedef struct CM2Profile                CM2Profile;
  434. typedef CM2Profile *                    CM2ProfilePtr;
  435. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  436. /* Tag Type Definitions */
  437.  
  438. struct CMCurveType {
  439.     OSType                             typeDescriptor;                /* 'curv' */
  440.     unsigned long                     reserved;                    /* fill with 0x00 */
  441.     unsigned long                     countValue;                    /* number of entries in table that follows */
  442.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  443. };
  444. typedef struct CMCurveType                CMCurveType;
  445.  
  446. struct CMDataType {
  447.     OSType                             typeDescriptor;                /* 'data' */
  448.     unsigned long                     reserved;                    /* fill with 0x00 */
  449.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  450.     char                             data[1];                    /* Tagged element storage. Variable size */
  451. };
  452. typedef struct CMDataType                CMDataType;
  453.  
  454. struct CMDateTimeType {
  455.     OSType                             typeDescriptor;                /* 'dtim' */
  456.     unsigned long                     reserved;
  457.     CMDateTime                         dateTime;
  458. };
  459. typedef struct CMDateTimeType            CMDateTimeType;
  460.  
  461. struct CMLut16Type {
  462.     OSType                             typeDescriptor;                /* 'mft2' */
  463.     unsigned long                     reserved;                    /* fill with 0x00 */
  464.     unsigned char                     inputChannels;                /* Number of input channels */
  465.     unsigned char                     outputChannels;                /* Number of output channels */
  466.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  467.     unsigned char                     reserved2;                    /* fill with 0x00 */
  468.     Fixed                             matrix[3][3];                /* */
  469.     unsigned short                     inputTableEntries;            /* */
  470.     unsigned short                     outputTableEntries;            /* */
  471.     unsigned short                     inputTable[1];                /* Variable size */
  472.     unsigned short                     CLUT[1];                    /* Variable size */
  473.     unsigned short                     outputTable[1];                /* Variable size */
  474. };
  475. typedef struct CMLut16Type                CMLut16Type;
  476.  
  477. struct CMLut8Type {
  478.     OSType                             typeDescriptor;                /* 'mft1' */
  479.     unsigned long                     reserved;                    /* fill with 0x00 */
  480.     unsigned char                     inputChannels;                /* */
  481.     unsigned char                     outputChannels;                /* */
  482.     unsigned char                     gridPoints;                    /* */
  483.     unsigned char                     reserved2;                    /* fill with 0x00 */
  484.     Fixed                             matrix[3][3];                /* */
  485.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  486.     unsigned char                     CLUT[2];                    /* Variable size */
  487.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  488. };
  489. typedef struct CMLut8Type                CMLut8Type;
  490.  
  491. struct CMMeasurementType {
  492.     OSType                             typeDescriptor;                /* 'meas' */
  493.     unsigned long                     reserved;                    /* fill with 0x00 */
  494.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  495.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  496.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  497.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  498.     unsigned long                     illuminant;                    /* standard illuminant */
  499. };
  500. typedef struct CMMeasurementType        CMMeasurementType;
  501.  
  502. struct CMNamedColorType {
  503.     OSType                             typeDescriptor;                /* 'ncol' */
  504.     unsigned long                     reserved;                    /* fill with 0x00 */
  505.     unsigned long                     vendorFlag;                    /* */
  506.     unsigned long                     count;                        /* count of named colors in array that follows */
  507.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  508.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  509.     char                             data[1];                    /* varaible size data as explained below */
  510. };
  511. typedef struct CMNamedColorType            CMNamedColorType;
  512. /*    
  513.     A variable size array of structs appears as the last block of data
  514.     in the above struct, CMNamedColorType.  The data structure
  515.     is as follows: (example in C)
  516.     
  517.     struct {                                             
  518.         unsigned char    rootName[1];                 * Variable size, max = 32 
  519.         unsigned char    colorCoords[1];                 * Variable size  
  520.     } colorName[1];                                     * Variable size  
  521. */
  522.  
  523. struct CMNamedColor2Type {
  524.     OSType                             typeDescriptor;                /* 'ncl2' */
  525.     unsigned long                     reserved;                    /* fill with 0x00 */
  526.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  527.     unsigned long                     count;                        /* count of named colors in array that follows */
  528.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  529.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  530.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  531.     char                             data[1];                    /* varaible size data as explained below */
  532. };
  533. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  534. /*    
  535.     A variable size array of structs appears as the last block of data
  536.     in the above struct, CMNamedColor2Type.  The data structure
  537.     is as follows: (example in C)
  538.     
  539.     struct {                                             
  540.         unsigned char    rootName[1];                 * 32 byte field.  7 bit ASCII null terminated
  541.         unsigned char    PCSColorCoords[1];             * Variable size  
  542.         unsigned char    DeviceColorCoords[1];         * Variable size  
  543.     } colorName2[1];                                 * Variable size  
  544. */
  545.  
  546.  
  547. struct CMTextDescriptionType {
  548.     OSType                             typeDescriptor;                /* 'desc' */
  549.     unsigned long                     reserved;                    /* fill with 0x00 */
  550.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  551.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  552.     unsigned long                     UniCodeCode;
  553.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  554.     unsigned char                     UniCodeName[2];                /* Variable size */
  555.     short                             ScriptCodeCode;
  556.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  557.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  558. };
  559. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  560.  
  561. struct CMTextType {
  562.     OSType                             typeDescriptor;                /* 'text' */
  563.     unsigned long                     reserved;                    /* fill with 0x00 */
  564.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  565. };
  566. typedef struct CMTextType                CMTextType;
  567.  
  568. struct CMScreeningType {
  569.     OSType                             typeDescriptor;                /* 'scrn' */
  570.     unsigned long                     reserved;                    /* fill with 0x00 */
  571.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  572.     unsigned long                     channelCount;
  573.     char                             data[1];                    /* varaible size data as explained below */
  574. };
  575. typedef struct CMScreeningType            CMScreeningType;
  576. /*
  577.     A variable size array of structs appears as the last block of data
  578.     in the above struct, CMScreeningType.  The data structure
  579.     is as follows: (example in C)
  580.     
  581.     struct {
  582.         Fixed            frequency;
  583.         Fixed            angle;
  584.         unsigned long    sportFunction;
  585.      }    channelScreening[1];                        * Variable size 
  586. */
  587.  
  588. struct CMSignatureType {
  589.     OSType                             typeDescriptor;                /* 'sig ' */
  590.     unsigned long                     reserved;                    /* fill with 0x00 */
  591.     OSType                             signature;
  592. };
  593. typedef struct CMSignatureType            CMSignatureType;
  594.  
  595. struct CMS15Fixed16ArrayType {
  596.     OSType                             typeDescriptor;                /* 'sf32' */
  597.     unsigned long                     reserved;                    /* fill with 0x00 */
  598.     Fixed                             value[1];                    /* Variable size */
  599. };
  600. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  601.  
  602. struct CMU16Fixed16ArrayType {
  603.     OSType                             typeDescriptor;                /* 'uf32' */
  604.     unsigned long                     reserved;                    /* fill with 0x00 */
  605.     unsigned long                     value[1];                    /* Variable size */
  606. };
  607. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  608.  
  609. struct CMUInt16ArrayType {
  610.     OSType                             typeDescriptor;                /* 'ui16' */
  611.     unsigned long                     reserved;                    /* fill with 0x00 */
  612.     unsigned short                     value[1];                    /* Variable size */
  613. };
  614. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  615.  
  616. struct CMUInt32ArrayType {
  617.     OSType                             typeDescriptor;                /* 'ui32' */
  618.     unsigned long                     reserved;                    /* fill with 0x00 */
  619.     unsigned long                     value[1];                    /* Variable size */
  620. };
  621. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  622.  
  623. struct CMUInt64ArrayType {
  624.     OSType                             typeDescriptor;                /* 'ui64' */
  625.     unsigned long                     reserved;                    /* fill with 0x00 */
  626.     unsigned long                     value[1];                    /* Variable size (x2) */
  627. };
  628. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  629.  
  630. struct CMUInt8ArrayType {
  631.     OSType                             typeDescriptor;                /* 'ui08' */
  632.     unsigned long                     reserved;                    /* fill with 0x00 */
  633.     unsigned char                     value[1];                    /* Variable size */
  634. };
  635. typedef struct CMUInt8ArrayType            CMUInt8ArrayType;
  636.  
  637. struct CMViewingConditionsType {
  638.     OSType                             typeDescriptor;                /* 'view' */
  639.     unsigned long                     reserved;                    /* fill with 0x00 */
  640.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  641.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  642.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  643. };
  644. typedef struct CMViewingConditionsType    CMViewingConditionsType;
  645.  
  646. struct CMXYZType {
  647.     OSType                             typeDescriptor;                /* 'XYZ ' */
  648.     unsigned long                     reserved;                    /* fill with 0x00 */
  649.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  650. };
  651. typedef struct CMXYZType                CMXYZType;
  652. /* Profile sequence description type */
  653.  
  654. struct CMProfileSequenceDescType {
  655.     OSType                             typeDescriptor;                /* 'pseq ' */
  656.     unsigned long                     reserved;                    /* fill with 0x00 */
  657.     unsigned long                     count;                        /* Number of descriptions */
  658.     char                             data[1];                    /* varaible size data as explained below */
  659. };
  660. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  661. /*
  662.     A variable size array of structs appears as the last block of data
  663.     in the above struct, CMProfileSequenceDescType.  The data structure
  664.     is as follows: (example in C)
  665.     
  666.     struct {                                             
  667.         OSType            deviceMfg;                     * Device Manufacturer 
  668.         OSType            deviceModel;                 * Decvice Model 
  669.         unsigned long    attributes[2];                 * Device attributes 
  670.         OSType            technology;                     * Technology signature 
  671.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  672.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  673.         unsigned long    mfgDescUniCodeCode;             
  674.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  675.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  676.         unsigned long    mfgDescScriptCodeCode;         
  677.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  678.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  679.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  680.         unsigned char    modelDescASCIIName[2];         * Variable size 
  681.         unsigned long    modelDescUniCodeCode;         
  682.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  683.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  684.         short            modelDescScriptCodeCode;     
  685.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  686.         SInt8            filler;                         * For proper alignment across languages 
  687.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  688.     }    profileDescription[1];                         
  689. */
  690.  
  691. /* Under color removal, black generation type */
  692.  
  693. struct CMUcrBgType {
  694.     OSType                             typeDescriptor;                /* 'bfd  ' */
  695.     unsigned long                     reserved;                    /* fill with 0x00 */
  696.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  697.     unsigned short                     ucrValues[1];                /* variable size */
  698.     unsigned long                     bgCount;                    /* Number of BG entries */
  699.     unsigned short                     bgValues[1];                /* variable size */
  700.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  701. };
  702. typedef struct CMUcrBgType                CMUcrBgType;
  703.  
  704. struct CMIntentCRDVMSize {
  705.     long                             renderingIntent;            /* rendering intent */
  706.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  707. };
  708. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  709.  
  710. struct CMPS2CRDVMSizeType {
  711.     OSType                             typeDescriptor;                /* 'psvm' */
  712.     unsigned long                     reserved;                    /* fill with 0x00 */
  713.     unsigned long                     count;                        /* number of intent entries */
  714.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  715. };
  716. typedef struct CMPS2CRDVMSizeType        CMPS2CRDVMSizeType;
  717. /* Video Card Gamma type */
  718.  
  719. enum {
  720.     cmVideoCardGammaTableType    = 0,
  721.     cmVideoCardGammaFormulaType    = 1
  722. };
  723.  
  724.  
  725.  
  726. struct CMVideoCardGammaTable {
  727.     unsigned short                     channels;                    /* # of gamma channels (1 or 3) */
  728.     unsigned short                     entryCount;                    /* 1-based number of entries per channel */
  729.     unsigned short                     entrySize;                    /* size on bytes of each entry */
  730.     char                             data[1];                    /* variable size data follows */
  731. };
  732. typedef struct CMVideoCardGammaTable    CMVideoCardGammaTable;
  733.  
  734. struct CMVideoCardGammaFormula {
  735.     Fixed                             redGamma;                    /* must be > 0.0 */
  736.     Fixed                             redMin;                        /* must be > 0.0 and < 1.0 */
  737.     Fixed                             redMax;                        /* must be > 0.0 and < 1.0 */
  738.     Fixed                             greenGamma;                    /* must be > 0.0 */
  739.     Fixed                             greenMin;                    /* must be > 0.0 and < 1.0 */
  740.     Fixed                             greenMax;                    /* must be > 0.0 and < 1.0 */
  741.     Fixed                             blueGamma;                    /* must be > 0.0 */
  742.     Fixed                             blueMin;                    /* must be > 0.0 and < 1.0 */
  743.     Fixed                             blueMax;                    /* must be > 0.0 and < 1.0 */
  744. };
  745. typedef struct CMVideoCardGammaFormula    CMVideoCardGammaFormula;
  746.  
  747. struct CMVideoCardGamma {
  748.     unsigned long                     tagType;
  749.     union {
  750.         CMVideoCardGammaTable             table;
  751.         CMVideoCardGammaFormula         formula;
  752.     }                                 u;
  753. };
  754. typedef struct CMVideoCardGamma            CMVideoCardGamma;
  755.  
  756. struct CMVideoCardGammaType {
  757.     OSType                             typeDescriptor;                /* 'vcgt' */
  758.     unsigned long                     reserved;                    /* fill with 0x00 */
  759.     CMVideoCardGamma                 gamma;
  760. };
  761. typedef struct CMVideoCardGammaType        CMVideoCardGammaType;
  762. /************************************************************************/
  763. /*************** ColorSync 1.0 profile specification ********************/
  764. /************************************************************************/
  765.  
  766. enum {
  767.     cmGrayResponse                = 0,
  768.     cmRedResponse                = 1,
  769.     cmGreenResponse                = 2,
  770.     cmBlueResponse                = 3,
  771.     cmCyanResponse                = 4,
  772.     cmMagentaResponse            = 5,
  773.     cmYellowResponse            = 6,
  774.     cmUcrResponse                = 7,
  775.     cmBgResponse                = 8,
  776.     cmOnePlusLastResponse        = 9
  777. };
  778.  
  779.  
  780. /* Device types */
  781.  
  782. enum {
  783.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  784.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  785.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  786. };
  787.  
  788.  
  789.  
  790. struct CMIString {
  791.     ScriptCode                         theScript;
  792.     Str63                             theString;
  793. };
  794. typedef struct CMIString                CMIString;
  795. /* Profile options */
  796.  
  797. enum {
  798.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  799.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  800.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  801. };
  802.  
  803. /* Profile flags */
  804.  
  805. enum {
  806.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  807.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  808. };
  809.  
  810.  
  811. typedef long                             CMMatchOption;
  812. typedef long                             CMMatchFlag;
  813.  
  814. struct CMHeader {
  815.     unsigned long                     size;
  816.     OSType                             CMMType;
  817.     unsigned long                     applProfileVersion;
  818.     OSType                             dataType;
  819.     OSType                             deviceType;
  820.     OSType                             deviceManufacturer;
  821.     unsigned long                     deviceModel;
  822.     unsigned long                     deviceAttributes[2];
  823.     unsigned long                     profileNameOffset;
  824.     unsigned long                     customDataOffset;
  825.     CMMatchFlag                     flags;
  826.     CMMatchOption                     options;
  827.     CMXYZColor                         white;
  828.     CMXYZColor                         black;
  829. };
  830. typedef struct CMHeader                    CMHeader;
  831.  
  832. struct CMProfileChromaticities {
  833.     CMXYZColor                         red;
  834.     CMXYZColor                         green;
  835.     CMXYZColor                         blue;
  836.     CMXYZColor                         cyan;
  837.     CMXYZColor                         magenta;
  838.     CMXYZColor                         yellow;
  839. };
  840. typedef struct CMProfileChromaticities    CMProfileChromaticities;
  841.  
  842. struct CMProfileResponse {
  843.     unsigned short                     counts[9];
  844.     unsigned short                     data[1];                    /* Variable size */
  845. };
  846. typedef struct CMProfileResponse        CMProfileResponse;
  847.  
  848. struct CMProfile {
  849.     CMHeader                         header;
  850.     CMProfileChromaticities         profile;
  851.     CMProfileResponse                 response;
  852.     CMIString                         profileName;
  853.     char                             customData[1];                /* Variable size */
  854. };
  855. typedef struct CMProfile                CMProfile;
  856. typedef CMProfile *                        CMProfilePtr;
  857. typedef CMProfilePtr *                    CMProfileHandle;
  858. #if OLDROUTINENAMES
  859.  
  860. enum {
  861.     kCMApplProfileVersion        = cmCS1ProfileVersion
  862. };
  863.  
  864.  
  865. enum {
  866.     grayResponse                = cmGrayResponse,
  867.     redResponse                    = cmRedResponse,
  868.     greenResponse                = cmGreenResponse,
  869.     blueResponse                = cmBlueResponse,
  870.     cyanResponse                = cmCyanResponse,
  871.     magentaResponse                = cmMagentaResponse,
  872.     yellowResponse                = cmYellowResponse,
  873.     ucrResponse                    = cmUcrResponse,
  874.     bgResponse                    = cmBgResponse,
  875.     onePlusLastResponse            = cmOnePlusLastResponse
  876. };
  877.  
  878.  
  879. enum {
  880.     rgbData                        = cmRGBData,
  881.     cmykData                    = cmCMYKData,
  882.     grayData                    = cmGrayData,
  883.     xyzData                        = cmXYZData
  884. };
  885.  
  886.  
  887. enum {
  888.     XYZData                        = cmXYZData
  889. };
  890.  
  891.  
  892. enum {
  893.     monitorDevice                = cmMonitorDevice,
  894.     scannerDevice                = cmScannerDevice,
  895.     printerDevice                = cmPrinterDevice
  896. };
  897.  
  898.  
  899. enum {
  900.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  901.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  902. };
  903.  
  904.  
  905. enum {
  906.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  907.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  908.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  909. };
  910.  
  911.  
  912. typedef unsigned short                     XYZComponent;
  913. typedef CMXYZColor                         XYZColor;
  914. typedef unsigned short                     CMResponseData;
  915. typedef CMIString                         IString;
  916. typedef long                             CMResponseColor;
  917. typedef CMResponseColor                 responseColor;
  918. #endif  /* OLDROUTINENAMES */
  919.  
  920.  
  921.  
  922. #if PRAGMA_STRUCT_ALIGN
  923.     #pragma options align=reset
  924. #elif PRAGMA_STRUCT_PACKPUSH
  925.     #pragma pack(pop)
  926. #elif PRAGMA_STRUCT_PACK
  927.     #pragma pack()
  928. #endif
  929.  
  930. #ifdef PRAGMA_IMPORT_OFF
  931. #pragma import off
  932. #elif PRAGMA_IMPORT
  933. #pragma import reset
  934. #endif
  935.  
  936. #ifdef __cplusplus
  937. }
  938. #endif
  939.  
  940. #endif /* __CMICCPROFILE__ */
  941.  
  942.